
package samples;
// {{{ imports
import jp.ize.ux.UXRoot;
import jp.ize.ux.UXObject;
import jp.ize.ux.events.UXMouseEvent;
import jp.ize.ux.geom.UXRect;
import jp.ize.ux.geom.UXSize;
import jp.ize.ux.components.UXEllipseBox;
import jp.ize.ux.components.UXImage;
import jp.ize.ux.acts.Act;
import jp.ize.ux.acts.EllipseAct;
import jp.ize.ux.acts.VisibilityAct;
import jp.ize.ux.tween.easings.Expo;

import jp.ize.iwp.RuntimeEngine;
import jp.ize.iwp.utils.DebugUtil;
// }}}
// {{{ class EllipseBox2
class EllipseBox2
{
	// {{{ public static function main()

	public static function main()
	{
		RuntimeEngine.init();
		DebugUtil.init();
		DebugUtil.setLocation( 300, 500 );
		var ellipseb = new UXEllipseBox(150,250,-90,90);
		var a = new EllipseAct();
		var v = new VisibilityAct();

		// EllipseRotateInteraction をMouseDown で起こすことにする。
		ellipseb.alpha = 0.2;
		ellipseb.ctrl.addInteraction( new UXEllipseRotateInteraction(1) );
		ellipseb.ctrl.getInteraction("Rotate").addReactEvent(UXMouseEvent.DOWN);

		// InitインタラクションをMouseOverのときに起こすことにし、その動作は0.3秒でlayoutすることにする。
		var actparam1:FadeParameter = {
			time:0.3,
			transition:Expo.easeOut,
			dir:VisibilityActDir.SHOW
		};
 		ellipseb.ctrl.getInteraction("Init").addReactEvent(UXMouseEvent.OVER);
 		ellipseb.ctrl.getInteraction("Init").addAct(v.fade(actparam1));
		var actparam3:ActParameter = {
			time:0.3,
			transition:Expo.easeOut
		};
 		ellipseb.ctrl.getInteraction("Init").addAct(a.layout(actparam3));

		ellipseb.x = 100;
		ellipseb.y = 300;
		ellipseb.addUXChild(new UXImage("Pref.png"));
		ellipseb.addUXChild(new UXImage("lambda-icon.png", new UXSize(100,100)));
		ellipseb.addUXChild(new UXImage("Safari.png"));
		ellipseb.addUXChild(new UXImage("ImageCapture.png"));
		ellipseb.addUXChild(new UXImage("TimeMachine.png"));
		ellipseb.addUXChild(new UXImage("iPhoto.png"));
		ellipseb.addUXChild(new UXImage("iTunes.png"));
		ellipseb.addUXChild(new UXImage("mail.png"));
		ellipseb.addUXChild(new UXImage("robot.png"));		
		UXRoot.addUXChild(ellipseb);
	}

	// }}}
}
// }}}
